package interfaces.rechercheiti;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class PanelPrefRadar extends PanelPref {
	protected JLabel labelRadars;
	protected JCheckBox checkRadars;
    
	public PanelPrefRadar (PanelRechercheItineraire _ri) {
		ri = _ri;
        labelRadars = new JLabel();
        checkRadars = new JCheckBox();
        
        setBackground(new Color(255, 255, 102));
        setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        setForeground(new Color(102, 102, 255));

        labelRadars.setForeground(new Color(255, 0, 0));
        labelRadars.setText("Radar");

        checkRadars.setText("Eviter");
        checkRadars.setOpaque(false);
        checkRadars.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent e) {
    			setIndifferent(!checkRadars.isSelected());
        	}
        });

        javax.swing.GroupLayout panelRadarsLayout = new javax.swing.GroupLayout(this);
        setLayout(panelRadarsLayout);
        panelRadarsLayout.setHorizontalGroup(
            panelRadarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRadarsLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelRadars, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(76, 76, 76)
                .addComponent(checkRadars)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 431, Short.MAX_VALUE)
                .addComponent(labelNumero)
                .addComponent(flecheMonter)
                .addComponent(flecheDescendre)
                .addContainerGap())
        );
        panelRadarsLayout.setVerticalGroup(
            panelRadarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelRadarsLayout.createSequentialGroup()
                .addGroup(panelRadarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelNumero)
                    .addComponent(flecheMonter)
                    .addComponent(flecheDescendre)
                    .addGroup(panelRadarsLayout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(panelRadarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(labelRadars, javax.swing.GroupLayout.DEFAULT_SIZE, 21, Short.MAX_VALUE)
                            .addComponent(checkRadars))))
                .addContainerGap())
        );
        panelRadarsLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new Component[] {labelNumero, flecheDescendre, flecheMonter});
        panelRadarsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new Component[] {labelNumero, flecheDescendre, flecheMonter});
    }
}